ForEach<TState>(Action<int, T, TState>, TState)

Method

Namespace: Ignis

Declared in: Ignis.IComponentCollection<T>


Iterates over each 'entity ID'-'component' pair using the supplied callback. Passes an additional parameter to the callback which can be used to avoid heap allocations by passing the required variables through it. Components can be added and removed inside the callback.

Syntax

public void ForEach<TState>(
	Action<int, T, TState> action,
	TState state
)

Parameters

action

Callback to be called on each pair

state

Additional parameter for the callback

See also

  • UpdateCurrent(T)

  • Back to index